<template>
  <div>
    <el-link type="danger"  v-if="$data.data.ready>0"
             @click="toRouteJump">{{ $data.data.ready }}</el-link>
    <el-link type="primary" v-else
             @click="toRouteJump">{{ $data.data.ready }}</el-link>
  </div>
</template>

<script>
import router from '@/components/storybook/router'

export default {
  data () {
    return {

    }
  },
  computed: {
    targetReportId () {
      return '1386509689588142081'
    }
  },
  methods: {
    toRouteJump () {
      if (Number(this.$data.data.ready) === 0) {
        return false
      }
      let botId = this.$data.data.version === '2' ? this.$data.data.id : this.$data.data.originalId
      router.push({
        path: `/dashboard-${this.targetReportId}`,
        query: {
          pageid: this.targetReportId,
          botId: botId,
          status: 'Ready'
        }
      })
    }
  }
}
</script>

<style>
</style>
